Repository navigation
feat: Freya OpenRouter operator and approachable UI - #9
surrealwolf wants to merge 9 commits into
Conversation
The UI update button pulls source but Freya skips the native rebuild step. Wire git pull + dotnet build into make targets and document the workflow. Co-authored-by: Cursor <[email protected]>
Stop only ComfyUI to preserve git state, use fetch+reset with retries, and skip rebuild/restart when SwarmUI is already current. Co-authored-by: Cursor <[email protected]>
Clear root for OpenRouter operator rebuild while keeping prior UI tooling reachable. Co-authored-by: Cursor <[email protected]>
Replace Compose/GPU UI default path with kube-rs studio, cloud+local generation router, and Civitai key install flow. Co-authored-by: Cursor <[email protected]>
Keep Freya operator Makefile/README; Compose SwarmUI updates already live under legacy/. Co-authored-by: Cursor <[email protected]>
The merge-base changed after approval.
Interactive mock/dev:mock path, lacquer mist theme, portrait icons, and suggest/session instruction packs with API assist enrichment for #9. Co-authored-by: Cursor <[email protected]>
Root compose moved with the operator cutover; Lint and Validate was failing with "no configuration file provided". Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 5 potential issues.
There are 19 total unresolved issues (including 14 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a9a2954. Configure here.
Contain asset dest paths, allowlist Civitai download hosts, optional FREYA_API_TOKEN + tighter CORS, drop shell eval on asset Jobs, and fix external worker URL / Job phase / LoRA local backend wiring. Co-authored-by: Cursor <[email protected]>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: ee193dd6-4be1-46ee-8688-fa51b7867802) |
There was a problem hiding this comment.
Stale comment
Agentic security review of the latest head: residual HIGH issues remain around fail-open API auth (operator never injects
FREYA_API_TOKEN), GET routes that still invoke stored provider keys, and unauthenticated worker asset install/SSRF. Prior findings on Civitai token leakage to arbitrary hosts, destPath traversal, and Jobevalinjection are addressed.Sent by Cursor Security Agent: Security Reviewer
Require bearer on protected GETs, wire apiTokenSecretRef and worker authSecretRef through the operator, and allowlist worker install hosts so cluster/Ingress deployments are not fail-open. Co-authored-by: Cursor <[email protected]>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 5b86fa20-efba-447c-9204-bd59bffb4ce2) |
There was a problem hiding this comment.
Agentic security review of the current head found three remaining issues: the UI proxy still presents a documented API bearer as if Ingress were authenticated, FreyaModelAsset can send a namespace Secret to an arbitrary download URL, and assist mode can read arbitrary .txt files as the system prompt.
Sent by Cursor Security Agent: Security Reviewer
| proxy_http_version 1.1; | ||
| proxy_set_header Host $host; | ||
| # Injected when FreyaStudio apiTokenSecretRef is set (empty = open local/dev). | ||
| proxy_set_header Authorization "Bearer ${FREYA_API_TOKEN}"; |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: HIGH
The UI nginx location for /v1/ always overwrites Authorization with FREYA_API_TOKEN. Ingress sends / to this UI Service, so any client that can load the studio (Internet when Ingress is enabled; any in-cluster pod otherwise) can call generate, PUT /v1/settings, and POST /v1/civitai/install without knowing the bearer. Direct hits to the API Service still require the token, which is what apiTokenSecretRef is documented to enforce for non-dev/Ingress.
Impact: Callers can persist provider keys, retarget diffusionWorkerUrl, spend OpenRouter credits, and drive worker installs as the studio.
Reviewed by Cursor Security Reviewer for commit c9bb5e0. Configure here.
| esac | ||
| mkdir -p "$(dirname "$DEST")" | ||
| if [ -n "${ASSET_TOKEN:-}" ]; then | ||
| curl -fL -H "Authorization: Bearer ${ASSET_TOKEN}" -o "$DEST" -- "$ASSET_URL" |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: HIGH
The in-cluster download Job attaches FreyaModelAsset.spec.secretRef as ASSET_TOKEN and sends it as Authorization: Bearer to spec.url with curl -fL (redirects, no host allowlist). That is weaker than civitai_install, which already refuses non-Civitai hosts before attaching a key. A principal who can create FreyaModelAsset in the namespace does not need get secrets to coerce the operator into presenting another Secret in that namespace to an attacker URL.
Impact: Namespace secrets referenced by secretRef can leave the cluster in the Authorization header of a caller-controlled download.
Reviewed by Cursor Security Reviewer for commit c9bb5e0. Configure here.
| } | ||
|
|
||
| pub async fn load_instruction(packs_dir: &Path, mode: &str) -> String { | ||
| let path = packs_dir.join("instructions").join(format!("{mode}.txt")); |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: MEDIUM
load_instruction joins attacker-controlled AssistRequest.mode into {packs}/instructions/{mode}.txt with no allowlist, no .. rejection, and no containment check. On Unix, an absolute mode replaces the base path via Path::join. A successful read becomes the OpenRouter system prompt. POST /v1/assist is on the public /v1 surface (and is reachable through the UI proxy without a caller-supplied bearer).
Impact: A network caller can make the API process read any .txt file it can open and send those contents to OpenRouter.
Reviewed by Cursor Security Reviewer for commit c9bb5e0. Configure here.




Summary
FreyaStudio, generations, styles, diffusion workers, model assets) instead of shipping ComfyUI/SwarmUI as the default pathlegacy/for referenceTest plan
cargo test --workspaceandmake vetpassmake run-apiwithOPENROUTER_API_KEY; UI viacd web && npm i && npm run devmake manifestsgenerates CRDs; sampleFreyaStudio/ external worker YAMLs look correctlegacy/still contains the prior Compose docs and MakefilesMade with Cursor
Note
High Risk
Large architectural cutover with new API auth, secret handling (OpenRouter/Civitai/worker tokens), and K8s operator reconciling deployments—misconfiguration could expose endpoints or break existing Compose users expecting root-level
make up.Reviewed by Cursor Bugbot for commit c9bb5e0. Bugbot is set up for automated code reviews on this repo. Configure here.